<?php
/**
 * 跃飞科技版权所有 @2017
 * Date: 2017/4/25
 * Time: 15:59
 */

namespace app\home\controller;

use think\Controller;
class Cases extends Controller
{
    public function index($cid='')
    {
        $casesModel = new \app\home\model\Cases();
        $data = $casesModel->search(trim($cid));
        //分类
        $_cases_cat = db('cases_cat')->field('cat_id,cat_name,parent_id')->select();
        $data['case_cat'] = $casesModel->getChildArr($_cases_cat);
        $data['cid'] = $cid;
        return $this->fetch('',$data);
    }

    public function detail()
    {
        return $this->fetch();
    }
}